package depricated;

/**
 * Facebook integration
 */

import java.io.IOException;
import java.util.List;
import javax.xml.*;

import com.facebook.api.FacebookException;
import com.facebook.api.FacebookRestClient;
import com.facebook.api.schema.FriendsGetResponse;
import com.facebook.api.*;

public class FaceBookServices {

	private static final String API_KEY = "b7e7c2da2e14a55f11650715ba04d11a"; 
    private static final String SECRET_KEY = "e5c95098abad203ef9c67cae09d8d089"; 
    public String status;
    public FacebookRestClient client;
	
	public void getContacts() throws FacebookException {
		try{
			
			client = new FacebookRestClient(API_KEY, SECRET_KEY);
			client.users_setStatus(status);
		    System.out.println(client.friends_get());
		    FriendsGetResponse response = (FriendsGetResponse)client.getResponsePOJO();
		    List<Long> friends = response.getUid();
		    System.out.println(friends.toString());

		}catch(Exception e) { 
            e.printStackTrace(); 
        }
	}

	public static void main(String[] args) throws FacebookException {
		FaceBookServices f = new FaceBookServices();
		f.getContacts();
	}
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) throws FacebookException, IOException {
		if (client.users_hasAppPermission(Permission.STATUS_UPDATE)) {
	        client.users_setStatus(status, false);
	    }
	}
	
}
